﻿using MiniFox.Platform.Applications.Models;
using MiniFox.Resources;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sys.Core.Models.Dto
{
    public class MenuLinkDto
    {
        /// <summary>
        /// 链接ID
        /// </summary>
        [JsonProperty("linkId")]
        public string? LinkID { get; set; }
        /// <summary>
        /// 菜单ID
        /// </summary>
        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [JsonProperty("menuId")]
        public string MenuID { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [JsonProperty("appId")]
        public string ApplicationID { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [MaxLength(20, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonStringLength")]
        [JsonProperty("linkName")]
        public string LinkName { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [MaxLength(500, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonStringLength")]
        [JsonProperty("linkUri")]
        public string LinkUri { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [MaxLength(20, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonStringLength")]
        [JsonProperty("label")]
        public string? Label { get; set; }
        /// <summary>
        /// 菜单图标
        /// </summary>
        [JsonProperty("icon")]
        public string? Icon { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("openMode"), JsonConverter(typeof(StringEnumConverter))]
        public OpenMode OpenMode { get; set; }
        /// <summary>
        /// 排序值
        /// </summary>
        [JsonProperty("ordinal")]
        public int? Ordinal { get; set; }
    }
}
